package com.xiaoyu.lanling.feature.moment.fragment.notice

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.xiaoyu.lanling.R
import com.xiaoyu.lanling.feature.moment.controller.notice.CommentNoticeListController
import com.xiaoyu.lanling.feature.moment.data.notice.CommentNoticeListData
import com.xiaoyu.lanling.view.OnShowFragment
import kotlinx.android.synthetic.main.fragment_comment_notice.*

class CommentNoticeFragment : OnShowFragment() {
    private lateinit var listController: CommentNoticeListController

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_comment_notice, container, false)
    }

    override fun onViewCreatedSafelyAfterAppFinishInit(view: View, savedInstanceState: Bundle?) {
        initData()
    }

    private fun initData() {
        activity?.let {
            listController = CommentNoticeListController.create(it, CommentNoticeListData(), swipe_refresh_layout, recyclerview)
            listController.loadFirstPageData()
        }
    }
}